﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:OMANEThemeConv="clr-namespace:OMANE.Common.UI.Theme"	>

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="OMANE_Base.xaml" />
        <ResourceDictionary Source="OMANE_Brushes.xaml" />

    </ResourceDictionary.MergedDictionaries>

    <OMANEThemeConv:GlossyStyleConverter x:Key="GlossyStyleConverter" />

    <Style x:Key="btnTool_OMANE_V2" TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
        <Setter Property="Background" Value="White" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
                    <Border
                        x:Name="Border"
                        CornerRadius="0"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}"
                        BorderBrush="{StaticResource BrushCouleur2Base}"
                        Padding="3">
                            <Image Grid.Column="0"
                                   VerticalAlignment="Stretch" 
                                   HorizontalAlignment="Stretch"
                                   Source="{TemplateBinding Icon}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefautMouseOver}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautMouseOverBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautMouseOverForeground}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefaultSelected}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautSelectedBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautSelectedForeground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="btnTool_OMANE_V3" TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
        <Setter Property="Background" Value="White" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
                    <Border
                        x:Name="Border"
                        CornerRadius="0"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}"
                        BorderBrush="{StaticResource BrushCouleur2Base}"
                        Padding="3">
                        <Image Grid.Column="0"
                                   VerticalAlignment="Stretch" 
                                   HorizontalAlignment="Stretch"
                                   Source="{TemplateBinding Icon}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="btnBase_OMANE_V2" TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
        <Setter Property="Height" Value="25" />
        <Setter Property="Width" Value="100" />
        <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
        <Setter Property="Background" Value="Green" />
        <Setter Property="Foreground" Value="White" />
		<Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type OMANEThemeConv:OMANEbtn}">
                    <Border
                        x:Name="Border"
                        CornerRadius="0"
                        BorderThickness="1"
                        Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}"
                        BorderBrush="{StaticResource BrushCouleur2Base}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="3" Source="{TemplateBinding Icon}" />
                            <ContentPresenter  Grid.Column="1" Margin="3,0,0,0" 
                                               HorizontalAlignment="Left" 
                                               VerticalAlignment="Center" 
                                               RecognizesAccessKey="True"
                                               Content="{TemplateBinding ContentControl.Content}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefautMouseOver}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautMouseOverBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautMouseOverForeground}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefaultSelected}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautSelectedBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautSelectedForeground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="btnBase_OMANE" TargetType="{x:Type Button}">
        <Setter Property="Height" Value="23" />
        <Setter Property="Width" Value="100" />
        <Setter Property="Background" Value="Green" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
                        x:Name="Border"
                        CornerRadius="0"
                        BorderThickness="1"
                        Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}"
                        BorderBrush="{StaticResource BrushCouleur2Base}">
                        <ContentPresenter Margin="2" 
                                          HorizontalAlignment="Center" 
                                          VerticalAlignment="Center" 
                                          RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefautMouseOver}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautMouseOverBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautMouseOverForeground}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border"  Property="Background" Value="{StaticResource DegradeDefaultSelected}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BrushDefautSelectedBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautSelectedForeground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Boutons de correspondance -->
    <Style x:Key="btnCorresp" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
                        x:Name="BorderExt"
                        CornerRadius="3"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        BorderBrush="{TemplateBinding BorderBrush}">
                        <Border
                            x:Name="BorderInt"
                            CornerRadius="3"
                            Margin="2,1,2,1"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}">
                            <ContentPresenter Margin="2" 
                                          HorizontalAlignment="Center" 
                                          VerticalAlignment="Center" 
                                          RecognizesAccessKey="True" />
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="BorderInt"  Property="Background" Value="{StaticResource DegradeDefautMouseOver}" />
                            <Setter TargetName="BorderInt" Property="BorderBrush" Value="{StaticResource BrushDefautMouseOverBorder}" />
                            <Setter TargetName="BorderExt" Property="BorderBrush" Value="{StaticResource BrushDefautMouseOverBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautMouseOverForeground}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="BorderInt"  Property="Background" Value="{StaticResource DegradeDefaultSelected}" />
                            <Setter TargetName="BorderInt" Property="BorderBrush" Value="{StaticResource BrushDefautSelectedBorder}" />
                            <Setter TargetName="BorderExt" Property="BorderBrush" Value="{StaticResource BrushDefautSelectedBorder}" />
                            <Setter Property="Foreground" Value="{StaticResource BrushDefautSelectedForeground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="btnCorrespEtat" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
                        x:Name="BorderExt"
                        CornerRadius="3"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        BorderBrush="{TemplateBinding BorderBrush}">
                        <Border
                            x:Name="BorderInt"
                            CornerRadius="3"
                            Margin="2,1,2,1"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Background="{TemplateBinding Background, Converter={StaticResource GlossyStyleConverter}}">
                            <ContentPresenter Margin="2" 
                                          HorizontalAlignment="Center" 
                                          VerticalAlignment="Center" 
                                          RecognizesAccessKey="True" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#F3F3F3" Offset="0"/>
        <GradientStop Color="#EBEBEB" Offset="0.5"/>
        <GradientStop Color="#DDDDDD" Offset="0.5"/>
        <GradientStop Color="#CDCDCD" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>


    <Style x:Key="SegmentEditorToggleButtonStyle" TargetType="{x:Type ToggleButton}">
        <Style.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Content" Value=""/>
                <Setter Property="ContextMenu" Value="{x:Null}"/>
            </Trigger>
        </Style.Triggers>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Background" Value="{DynamicResource DefaultBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BrushCouleur1BckClaire}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="Chrome" 
					BorderBrush="{TemplateBinding BorderBrush}" 
					Background="{TemplateBinding Background}"
					SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
                    <ContentPresenter 
						HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
						Margin="{TemplateBinding Padding}" 
						RecognizesAccessKey="True" 
						SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
						VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="25"/>
		<Setter Property="Height" Value="25"/>
        <Setter Property="Margin" Value="5,0,0,0"/>
        <Setter Property="Content" Value="S"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Setter.Value>
        </Setter>
        <Setter Property="ContextMenu">
            <Setter.Value>
                <ContextMenu 
                    Placement="Right" 
                    AlternationCount="1" 
                    Opacity="0.75" 
                    DataContext="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget}" Background="{DynamicResource DegradeBckTitre}" Foreground="{DynamicResource BrushCouleur1Base}" FontWeight="Bold"
                     >
                    <!--<MenuItem Header="Edit" Command="{Binding Path=DataContext.EditCommand}" CommandParameter="Edit" />
                    <MenuItem Header="Reset" Command="{Binding Path=DataContext.ResetCommand}"  CommandParameter="Reset"  />
                    <MenuItem Header="Load" Command="{Binding Path=DataContext.LoadCommand}"  CommandParameter="Load" />
                    <Separator />-->
                    <MenuItem Header="Copy" Command="{Binding Path=DataContext.CopyCommand}"  CommandParameter="Copy"/>
                    <MenuItem Header="Paste" Command="{Binding Path=DataContext.PasteCommand}"  CommandParameter="Paste"/>
                    <ContextMenu.Style>
                        <Style  TargetType="{x:Type ContextMenu}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ContextMenu}">
                                        <Border Uid="Border_93">
                                            <Border.Style>
                                                <Style TargetType="{x:Type Border}">
                                                    <Setter Property="Tag" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"/>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="True">
                                                            <Setter Property="Background" Value="Transparent"/>
                                                            <Setter Property="Padding" Value="0,0,5,5"/>
                                                            <Setter Property="Effect">
                                                                <Setter.Value>
                                                                    <DropShadowEffect BlurRadius="4" Opacity="0.8" ShadowDepth="1"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Border.Style>
                                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Uid="Border_50">
                                                <ScrollViewer CanContentScroll="True" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" Uid="ScrollViewer_9">
                                                    <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Uid="ItemsPresenter_5"/>
                                                </ScrollViewer>
                                            </Border>
                                        </Border>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ContextMenu.Style>
                </ContextMenu>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
